import sys 
from PySide2.QtMultimedia import *
from PySide2.QtMultimediaWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from .widgets.VideoWidget import ALVideoWidget
from .utils.styles import STYLES



class CGAIAL(QWidget):

    def __init__(self):
        super(CGAIAL,self).__init__()

        self.setWindowTitle('资产库')
        self.setStyleSheet(STYLES.COLOR_STYLES)
        self.main_layout = QVBoxLayout()
        self.tool_layout = QHBoxLayout()
        self.tool_btn1 = QPushButton('tool1')
        self.tool_btn2 = QPushButton('tool2')
        self.tool_btn3 = QPushButton('tool3')
        self.tool_layout.addWidget(self.tool_btn1)
        self.tool_layout.addWidget(self.tool_btn2)
        self.tool_layout.addWidget(self.tool_btn3)
        
        self.grid_layout = QGridLayout()
        self.init_grid()

        self.main_layout.addLayout(self.tool_layout)
        self.main_layout.addLayout(self.grid_layout)
        self.setLayout(self.main_layout)
    
    def init_grid(self):
        """
        pass 
        """
        row = 3
        column = 3

        for r in range(row):
            for c in range(column):
                v = ALVideoWidget('视频名称',r'C:\Users\Administrator\Desktop\每个大声喊出的愿意都应被听见.mp4')
                self.grid_layout.addWidget(v,r,c)
        

if __name__ == '__main__':
     app = QApplication([])
     window = CGAIAL()
     window.show()
     sys.exit(app.exec_())
    
